//
//  ViewController.m
//  HYBTimerExtension
//
//  Created by huangyibiao on 15/4/16.
//  Copyright (c) 2015年 huangyibiao. All rights reserved.
//

#import "ViewController.h"
#import "NSTimer+HYBExtension.h"

@interface ViewController ()
@property (weak, nonatomic) IBOutlet UILabel *label;

@end

@implementation ViewController

- (void)viewDidLoad {
  [super viewDidLoad];
  // Do any additional setup after loading the view, typically from a nib.
    
    __block int time = 30;
    NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:1.0
                                                    repeats:YES
                                                   callback:^() {
                                                       
                                                       self.label.text = [NSString stringWithFormat:@"%d", time--];
                                                       
                                                   }];
    [[NSRunLoop currentRunLoop] addTimer:timer forMode:NSRunLoopCommonModes];
    

    
    
    
    
    
}

- (void)didReceiveMemoryWarning {
  [super didReceiveMemoryWarning];
  // Dispose of any resources that can be recreated.
}

@end
